﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NEWAdminDelete.aspx.cs" Inherits="mpsalaryprojectgroup.NEWAdminDelete" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Welcome to the PGS Portal</title>

    <link rel ="stylesheet" href= "Styles/jquery-ui-1.8.17.custom.css" type="text/css" />
    <link rel="stylesheet" href= "Styles/jquery.ui.all.css" type="text/css" />
    <style type="text/css">
        .style1
        {
            color: #FF9933;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <meta charset="utf-8" />
        
	<!-- Set the viewport width to device width for mobile -->
	<meta name="viewport" content="initial-scale=1, maximum-scale=1" />

	<title>Welcome to the PGS Portal</title>
  
	<!-- Included CSS Files -->
	<link rel="stylesheet" href="CSS\foundation.css">
	<link rel="stylesheet" href="CSS\app.css">
    <link rel="stylesheet" href="CSS\ie.css">


	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

    <!--CSS for hover over navigation tab-->
    
    <link rel="stylesheet" href="CSS/Tab.css">
    <script type="text/javascript" src="dropdown_menu.js"></script>
    <script type="text/javascript">
        var websiteID = 'thedesignsuperhero.com';
    </script>
    <script type="text/javascript" src="http://analytics.hosting24.com/s.php"></script>
    <noscript>
    <a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/s.php?websiteID=thedesignsuperhero.com" alt="web hosting" /></a>
    </noscript>

       <!--Navigation tab part 2 -->
<script>
    // Javascript originally by Patrick Griffiths and Dan Webb.
    // http://htmldog.com/articles/suckerfish/dropdowns/
    sfHover = function () {
        var sfEls = document.getElementById("navbar").getElementsByTagName("li");
        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function () {
                this.className += " hover";
            }
            sfEls[i].onmouseout = function () {
                this.className = this.className.replace(new RegExp(" hover\\b"), "");
            }
        }
    }
    if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
    
   <%-- <link rel="stylesheet" href="CSS\Tab1.css">--%>

    <div class="container">
		<div class="row">
			<div class="twelve columns" align="center">
				<h2><img alt="" src="Images/orangesample%20copy.jpg" /></h2>
			</div>
		</div>


    <div class="row">
        <!--for navigation tab-->
            <%--<ul id="button">

         <li><a href="#">Home</a></li>
         <li><a href="#">About</a></li>
         <li><a href="#">Services</a></li>
         <li><a href="#">Clients</a></li>
         <li><a href="#">Products</a></li>
         <li><a href="#">F.A.Q</a></li>
         <li><a href="#">Contact Us</a></li>
         <li><a href="/NEWMainPage.aspx">Sign Out</a></li>
           </ul>--%>


        <!--Navigation part 2-->
		<ul id="navbar">
			<li><a href="NEWAdminUploadResult.aspx">Home</a>
            <!-- put link to link back to homepage -->
			</li>
			<li><a href="NEWUpdateData.aspx">Edit</a>			
			</li>
            <%--<li><a href="/NEWAnalytical.aspx">Analytical</a>
                <ul>
                    <li><a href="/NEWAnalytical.aspx">Analyse</a></li>
                    <li><a href="/NEWNEWReport.aspx">Report</a></li>
                </ul>
            </li>--%>

			<%--<li><a href="/NEWAdminContactUs.aspx">Contact Us</a>
				<!--put contact details plus google map-->		
			</li>--%>
			<li><a href="NEWAdminDelete.aspx">Delete Users</a>	
                <ul>
				</ul>            	
			</li>

            <li><a href="NEWMainPage.aspx">Logout</a>	
                <ul>
                </ul>        	
			</li>

		</ul>
</div>

    <div class="row">
        <div class="twelve columns">
            Dear
            <asp:Label ID="lblUsername" runat="server" Font-Bold="True"></asp:Label>
            ,</div>
    </div>

    <div class="row">
        
        <div class="row">
        <div class="twelve columns" align="center">
            <h3 class="style1">Delete User</h3>
        </div>
    </div>

        <div class="four columns">
        </div>

        <div class="four columns">
        </div>
    </div>
    <br />

    <div class="row">
            <div class="twelve columns" align="center">
            <asp:Panel ID="PanelView" runat="server" Width="945px">
                <asp:GridView ID="GridViewExcel" CssClass="adminDelete" runat="server" HorizontalAlign="Center" 
                    AllowPaging="True" AutoGenerateColumns="False" 
                    DataSourceID="SqlDataSource2" BackColor="LightGoldenrodYellow" 
                    BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" 
                    GridLines="None" DataKeyNames="Usename,Email">
                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" />
                        <asp:BoundField DataField="Usename" HeaderText="Usename" ReadOnly="True" 
                            SortExpression="Usename" />
                        <asp:BoundField DataField="Salutation" HeaderText="Salutation" 
                            SortExpression="Salutation" />
                        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                            SortExpression="FirstName" />
                        <asp:BoundField DataField="LastName" HeaderText="LastName" 
                            SortExpression="LastName" />
                        <asp:BoundField DataField="NRIC" HeaderText="NRIC" SortExpression="NRIC" />
                        <asp:BoundField DataField="Email" HeaderText="Email" ReadOnly="True" 
                            SortExpression="Email" />
                        <asp:BoundField DataField="MobileNumber" HeaderText="MobileNumber" 
                            SortExpression="MobileNumber" />
                        <asp:BoundField DataField="Occupation" HeaderText="Occupation" 
                            SortExpression="Occupation" />
                    </Columns>
                    <FooterStyle BackColor="Tan" />
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                        HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                    <SortedAscendingCellStyle BackColor="#FAFAE7" />
                    <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                    <SortedDescendingCellStyle BackColor="#E1DB9C" />
                    <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:dbConn %>" 
                    DeleteCommand="DELETE FROM [User] WHERE [Usename] = @original_Usename AND [Email] = @original_Email AND (([Salutation] = @original_Salutation) OR ([Salutation] IS NULL AND @original_Salutation IS NULL)) AND (([FirstName] = @original_FirstName) OR ([FirstName] IS NULL AND @original_FirstName IS NULL)) AND (([LastName] = @original_LastName) OR ([LastName] IS NULL AND @original_LastName IS NULL)) AND (([NRIC] = @original_NRIC) OR ([NRIC] IS NULL AND @original_NRIC IS NULL)) AND (([MobileNumber] = @original_MobileNumber) OR ([MobileNumber] IS NULL AND @original_MobileNumber IS NULL)) AND (([Occupation] = @original_Occupation) OR ([Occupation] IS NULL AND @original_Occupation IS NULL))" 
                    InsertCommand="INSERT INTO [User] ([Usename], [Salutation], [FirstName], [LastName], [NRIC], [Email], [MobileNumber], [Occupation]) VALUES (@Usename, @Salutation, @FirstName, @LastName, @NRIC, @Email, @MobileNumber, @Occupation)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT [Usename], [Salutation], [FirstName], [LastName], [NRIC], [Email], [MobileNumber], [Occupation] FROM [User]" 
                    UpdateCommand="UPDATE [User] SET [Salutation] = @Salutation, [FirstName] = @FirstName, [LastName] = @LastName, [NRIC] = @NRIC, [MobileNumber] = @MobileNumber, [Occupation] = @Occupation WHERE [Usename] = @original_Usename AND [Email] = @original_Email AND (([Salutation] = @original_Salutation) OR ([Salutation] IS NULL AND @original_Salutation IS NULL)) AND (([FirstName] = @original_FirstName) OR ([FirstName] IS NULL AND @original_FirstName IS NULL)) AND (([LastName] = @original_LastName) OR ([LastName] IS NULL AND @original_LastName IS NULL)) AND (([NRIC] = @original_NRIC) OR ([NRIC] IS NULL AND @original_NRIC IS NULL)) AND (([MobileNumber] = @original_MobileNumber) OR ([MobileNumber] IS NULL AND @original_MobileNumber IS NULL)) AND (([Occupation] = @original_Occupation) OR ([Occupation] IS NULL AND @original_Occupation IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_Usename" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_Salutation" Type="String" />
                        <asp:Parameter Name="original_FirstName" Type="String" />
                        <asp:Parameter Name="original_LastName" Type="String" />
                        <asp:Parameter Name="original_NRIC" Type="String" />
                        <asp:Parameter Name="original_MobileNumber" Type="Int32" />
                        <asp:Parameter Name="original_Occupation" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Usename" Type="String" />
                        <asp:Parameter Name="Salutation" Type="String" />
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="NRIC" Type="String" />
                        <asp:Parameter Name="Email" Type="String" />
                        <asp:Parameter Name="MobileNumber" Type="Int32" />
                        <asp:Parameter Name="Occupation" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Salutation" Type="String" />
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="NRIC" Type="String" />
                        <asp:Parameter Name="MobileNumber" Type="Int32" />
                        <asp:Parameter Name="Occupation" Type="String" />
                        <asp:Parameter Name="original_Usename" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_Salutation" Type="String" />
                        <asp:Parameter Name="original_FirstName" Type="String" />
                        <asp:Parameter Name="original_LastName" Type="String" />
                        <asp:Parameter Name="original_NRIC" Type="String" />
                        <asp:Parameter Name="original_MobileNumber" Type="Int32" />
                        <asp:Parameter Name="original_Occupation" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:dbConn %>" 
                    DeleteCommand="DELETE FROM [User] WHERE [Usename] = @original_Usename AND [Email] = @original_Email AND (([FirstName] = @original_FirstName) OR ([FirstName] IS NULL AND @original_FirstName IS NULL)) AND (([LastName] = @original_LastName) OR ([LastName] IS NULL AND @original_LastName IS NULL)) AND (([NRIC] = @original_NRIC) OR ([NRIC] IS NULL AND @original_NRIC IS NULL)) AND (([MobileNumber] = @original_MobileNumber) OR ([MobileNumber] IS NULL AND @original_MobileNumber IS NULL)) AND (([Occupation] = @original_Occupation) OR ([Occupation] IS NULL AND @original_Occupation IS NULL)) AND (([Salutation] = @original_Salutation) OR ([Salutation] IS NULL AND @original_Salutation IS NULL))" 
                    InsertCommand="INSERT INTO [User] ([FirstName], [Usename], [LastName], [NRIC], [MobileNumber], [Email], [Occupation], [Salutation]) VALUES (@FirstName, @Usename, @LastName, @NRIC, @MobileNumber, @Email, @Occupation, @Salutation)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT [FirstName], [Usename], [LastName], [NRIC], [MobileNumber], [Email], [Occupation], [Salutation] FROM [User]" 
                    UpdateCommand="UPDATE [User] SET [FirstName] = @FirstName, [LastName] = @LastName, [NRIC] = @NRIC, [MobileNumber] = @MobileNumber, [Occupation] = @Occupation, [Salutation] = @Salutation WHERE [Usename] = @original_Usename AND [Email] = @original_Email AND (([FirstName] = @original_FirstName) OR ([FirstName] IS NULL AND @original_FirstName IS NULL)) AND (([LastName] = @original_LastName) OR ([LastName] IS NULL AND @original_LastName IS NULL)) AND (([NRIC] = @original_NRIC) OR ([NRIC] IS NULL AND @original_NRIC IS NULL)) AND (([MobileNumber] = @original_MobileNumber) OR ([MobileNumber] IS NULL AND @original_MobileNumber IS NULL)) AND (([Occupation] = @original_Occupation) OR ([Occupation] IS NULL AND @original_Occupation IS NULL)) AND (([Salutation] = @original_Salutation) OR ([Salutation] IS NULL AND @original_Salutation IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_Usename" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_FirstName" Type="String" />
                        <asp:Parameter Name="original_LastName" Type="String" />
                        <asp:Parameter Name="original_NRIC" Type="String" />
                        <asp:Parameter Name="original_MobileNumber" Type="Int32" />
                        <asp:Parameter Name="original_Occupation" Type="String" />
                        <asp:Parameter Name="original_Salutation" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="Usename" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="NRIC" Type="String" />
                        <asp:Parameter Name="MobileNumber" Type="Int32" />
                        <asp:Parameter Name="Email" Type="String" />
                        <asp:Parameter Name="Occupation" Type="String" />
                        <asp:Parameter Name="Salutation" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="NRIC" Type="String" />
                        <asp:Parameter Name="MobileNumber" Type="Int32" />
                        <asp:Parameter Name="Occupation" Type="String" />
                        <asp:Parameter Name="Salutation" Type="String" />
                        <asp:Parameter Name="original_Usename" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_FirstName" Type="String" />
                        <asp:Parameter Name="original_LastName" Type="String" />
                        <asp:Parameter Name="original_NRIC" Type="String" />
                        <asp:Parameter Name="original_MobileNumber" Type="Int32" />
                        <asp:Parameter Name="original_Occupation" Type="String" />
                        <asp:Parameter Name="original_Salutation" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                </asp:Panel>
            </div>
        </div>

        <div class="four columns">
        </div>

        <div class="four columns">
        </div>
    
    </div>

</div>
   

        

    

    <div class="row">
        <div class="twelve columns" align="center">
        <br />
        <br />
        <br />
        <br />
        <br />
            <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/school.JPG" />
            <div class="six column"></div>
        </div>
    </div>

    <!-- Included JS Files -->
	<script src="javascripts/foundation.js"></script>
	<script src="javascripts/app.js"></script>
    <script src="jquery/jquery-ui-1.8.17.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#datepicker').datepicker({
                inline: true
            });
        });
    </script>
    </form>
</body>
</html>
